﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using com.lover.astd.common.config;
using com.lover.astd.common.model;
using com.lover.astd.common;

namespace com.lover.astd.game.ui.server.impl.economy
{
    /// <summary>
    /// 宴会服务
    /// </summary>
    class DinnerServer : LogicServer
    {
        public DinnerServer(MainForm frm) { _mainForm = frm; ServerName = ConfigStrings.S_Dinner; ServerReadableName = ConfigStrings.SR_Dinner; }
        public override void renderSettings()
        {
            Dictionary<string, string> confs = getConfig(ServerName);
            MainForm frm = _mainForm;
            if (confs.Count == 0 || !confs.ContainsKey(ConfigStrings.enabled) || !confs[ConfigStrings.enabled].ToLower().Equals("true"))
            {
                frm.chk_dinner.Checked = false;
            }
            else
            {
                frm.chk_dinner.Checked = true;
            }
        }
        public override void saveSettings()
        {
            GameConfig conf = getConfig();
            MainForm frm = _mainForm;
            conf.setConfig(ServerName, ConfigStrings.enabled, frm.chk_dinner.Checked.ToString());
        }
        public override void loadDefaultSettings()
        {
            GameConfig conf = getConfig();
            conf.setConfig(ServerName, ConfigStrings.enabled, "true");
            renderSettings();
        }

    }
}
